import 'package:flutter/material.dart';

class DefineCircle extends StatefulWidget {

  const DefineCircle({super.key});

  @override
  State createState() =>  DefineCircleState();
}

class DefineCircleState extends State<DefineCircle> {
   @override
   Widget build(BuildContext context) {
     return CustomPaint(
         size: const Size(60, 60),
         painter: CirclePainter(Colors.pink),
     );
   }
}

class CirclePainter extends CustomPainter {

  var _drawPaint;

  final double mRadius = 30;
  Offset offset = const Offset(30, 30);

  CirclePainter(Color mColor) {
     _drawPaint = Paint()
        ..color = mColor
        ..isAntiAlias = true
        ..filterQuality = FilterQuality.high;
  }

  @override
  void paint(Canvas canvas, Size size) {
    canvas.drawCircle(offset, mRadius, _drawPaint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
      return oldDelegate != this;
  }
}